package GameMath;

import org.newdawn.slick.geom.Vector2f;

/** Game point class
 * @author Aikidos
 */
public class GPoint {
	public int x;
	public int y;
	
	public GPoint(int x, int y) {
		this.x = x;
		this.y = y;
	}

	public GPoint() {
	}
	
	public GPoint(GPoint other) {
		x = other.x;
		y = other.y;
	}

	/** Returns distance between two points
	 * @param other - Other point
	 * @return Distance 
	 */
	public float distance(GPoint other) {
		return new Vector2f(x, y).distance(new Vector2f(other.x, other.y));
	}

	public void set(GPoint other) {
		x = other.x;
		y = other.y;
	}
	
	public void add(GPoint other) {
		this.x += other.x;
		this.y += other.y;
	}
	
	@Override
	public String toString() {
		return String.valueOf(x) + " : " + String.valueOf(y);
	}

}
